function isTxtFile(fileName) {
    return fileName.endsWith('.txt');
}
function create(info) {
    const ts = info.typescript;
    const proxy = Object.create(null);
    proxy.getQuickInfoAtPosition = (fileName, position) => {
        try {
            if (!isTxtFile(fileName))
                return info.languageService.getQuickInfoAtPosition(fileName, position);
            if (!ts.sys || !ts.sys.readFile) return info.languageService.getQuickInfoAtPosition(fileName, position);
            const content = ts.sys.readFile(fileName, 'utf8') ?? '';
            const literalType = JSON.stringify(content.trimEnd());
            return {
                kind: ts.ScriptElementKind.string,
                kindModifiers: '',
                textSpan: { start: 0, length: content.length },
                displayParts: [
                    { kind: 'text', text: `literal type: ${literalType}` }
                ]
            };
        } catch (e) {
            return info.languageService.getQuickInfoAtPosition(fileName, position);
        }
    };
    return proxy;
}
module.exports = { create };